package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class SelectList {

    private int beginIndex;
    private int endIndex;
    private boolean asterisk;
    private List<SelectSublist> selectSublistList;

    public SelectList(int beginIndex, int endIndex) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.asterisk = true;
    }

    public SelectList(List<SelectSublist> selectSublistList) {
        this.beginIndex = selectSublistList.get(0).getBeginIndex();
        this.endIndex = selectSublistList.get(selectSublistList.size() - 1).getEndIndex();
        this.selectSublistList = selectSublistList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isAsterisk() {
        return asterisk;
    }

    public int size() {
        return selectSublistList.size();
    }

    public SelectSublist get(int index) {
        return selectSublistList.get(index);
    }

}
